package com.cy.pj.common.web;

import com.cy.pj.common.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(ArithmeticException.class)
    public Result doHandleArithmeticException(ArithmeticException e){
        e.printStackTrace();
        log.info("exception {}",e.getMessage());
        return new Result(e);
    }
}
